import React, { useState, useEffect } from 'react';

export default function CountMyRenders () {
  const [countRender, setCountRender] = useState(0);

  useEffect(() => {
    setCountRender(val => val + 1);
  });

  return (
    // eslint-disable-next-line react/no-unescaped-entities
    <div>I've rendered {countRender} times</div>
  );
}
